사이트 내 전체검색
PHP
Ip 주소 php 의 위치를 확인하는 방법
하우코드
https://cmd.kr/php/959 URL이 복사되었습니다.

본문

코드 예제

3
0

php 는 ip 주소에서 위치 가져 오기

         $ip = $_SERVER['REMOTE_ADDR'];
$details = json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"));
echo$details->city; // -> "Mountain View"
         
1
0

Ip 주소 위치 찾기 php

         //You can use an api://Link to documentation: https://ip-get-geolocation.com/documentation/$LocationArray = json_decode( file_get_contents('http://ip-get-geolocation.com/api/json/35.188.125.133'), true); 	
echo$LocationArray['country']; 	
echo$LocationArray['city']; 	
echo$LocationArray['region']; 	
echo$LocationArray['timezone']; 
         

댓글목록

등록된 댓글이 없습니다.

PHP
871 (1/18P)

Search

Copyright © Cmd 명령어 18.119.132.223